<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
//
//Route::get('/', function () {
//    return 'Bad Request';
//});
Route::namespace('App\Http\Controllers\Web')->group(function () {
    Route::get('login', 'LoginController@index');
    //登录+注册处理
    Route::post('login/loginOperation', 'LoginController@loginOperation');
});
//加载im用户好友列表
Route::namespace('App\Http\Controllers\Web')->group(function () {
    Route::get('im/indexList', 'ImController@indexList')->name('im.indexList');
    //加载im用户聊天页面
    Route::get('im/chat/{friend_id}', 'ImController@chat')->name('im.chat');
    //绑定用户
    Route::post('im/binding', 'ImController@binding')->name('im.binding');
    //发送消息
    Route::post('im/sendMessage', 'ImController@sendMessage')->name('im.sendMessage');
});


//
//Route::get('/', function () {
//    return view('index');
//});
//Route::get('user',function (){
//   return view('user');
//});
